package com.hliushi.oauth2.config;

import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;

/**
 * Redis配置
 *
 * @author llhuang10
 */
// @Configuration
public class RedisConfig {


    /**
     * Redis 连接的线程安全工厂
     * 这个连接工厂会自动把我们的token放到redis中去
     */
    // @Autowired
    private RedisConnectionFactory redisConnectionFactory;

    // @Bean
    public TokenStore redisTokenStore() {
        return new RedisTokenStore(redisConnectionFactory);
    }
}
